#include <cstddef>

#include <boost/test/unit_test.hpp>

#include <phalanx/type_traits/is_builtin_vector.hpp.cu>

#define check( type ) \
  BOOST_REQUIRE(( phalanx::is_builtin_vector< type >::value ))

#define check_neg( type ) \
  BOOST_REQUIRE(( !phalanx::is_builtin_vector< type >::value ))

#define dup_check_neg( type ) \
  check_neg( type ); \
  check_neg( unsigned type )

#define check_v( type ) \
  check( type ## 1 ); \
  check( type ## 2 ); \
  check( type ## 3 ); \
  check( type ## 4 )

#define dup_check_v( type ) \
  check_v( type ); \
  check_v( u ## type )

namespace ns_is_builtin_vector
{

BOOST_AUTO_TEST_CASE( integer )
{
    dup_check_v( char );
    dup_check_v( short );
    dup_check_v( int );
    dup_check_v( long );
    dup_check_v( longlong );

    dup_check_neg( char );
    dup_check_neg( short );
    dup_check_neg( int );
    dup_check_neg( long );
}

BOOST_AUTO_TEST_CASE( floating_point )
{
    check_v( float );
    check_v( double );

    check_neg( float );
    check_neg( double );
}

BOOST_AUTO_TEST_CASE( others )
{
    check( dim3 );

    check_neg( std::size_t );
    check_neg( std::ptrdiff_t );
}

} // namespace ns_is_builtin_vector

